<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<script
	src="${staticPath}/lib/datetimepicker/0.0.11/js/bootstrap-datetimepicker.min.js"
	type="text/javascript"></script>
<script
	src="${staticPath}/lib/datetimepicker/0.0.11/js/locales/bootstrap-datetimepicker.zh-CN.js"
	type="text/javascript"></script>
<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js"
	type="text/javascript"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$(".o-a-form-date").datetimepicker({
			language : 'zh-CN',
			autoclose : true,
			minView : 2,
			todayBtn : 1,
			pickerPosition : "bottom-left"
		});
	});
	
	function checkData(){
		if ($("#endDate").val().length !=0 && $("#startDate").val().length!=0) {
				if ($("#endDate").val() < $("#startDate").val()) {
					alert("结束日期小于开始日期,请重新选择日期！");
					return false;
				} else {
					return true;
				}
			}
	      return  true;
		}
</script>

</head>
<body>
	<form:form name="listForm" modelAttribute="supplierRebate"
		method="post" class="form-inline" role="form">
		<ol class="breadcrumb map_1">
			<li><a href="${contextPath}/index">首页</a></li>
			<li><a
				href="${contextPath}/biz/example/form/elements?navId=${navId}">结算对账</a></li>
			<li class="active">返利单</li>
		</ol>
		<div class="o-l-search-builder f_1">
				<div class="f_2">
					<div class="form-group col-sm-6">
						<label for="inputEmail3" class="col-sm-3 control-label f_4">开始日期：</label>
						<div class="col-sm-9 f_6">
							<div class="input-group date o-a-form-date" data-date=""
								data-date-format="yyyy-mm-dd">
								<input class="form-control f_13" id="startDate" name="startDate"
									value="<fmt:formatDate value="${supplierRebate.startDate}" pattern="yyyy-MM-dd"/>"
									type="text" readonly /> <span class="input-group-addon f_time"><i
									class="glyphicon glyphicon-remove"></i></span> <span
									class="input-group-addon f_time"><span
									class="glyphicon glyphicon-calendar"></span></span>
							</div>
						</div>
					</div>
					<div class="form-group col-sm-6">
						<label for="inputEmail3" class="col-sm-3 control-label f_4">结束日期:</label>
						<div class="col-sm-9 f_6">
							<div class="input-group date o-a-form-date" data-date=""
								data-date-format="yyyy-mm-dd">
								<input class="form-control f_13" name="endDate" id="endDate"
									value="<fmt:formatDate value="${supplierRebate.endDate}" pattern="yyyy-MM-dd"/>"
									type="text" readonly /> <span class="input-group-addon f_time"><i
									class="glyphicon glyphicon-remove"></i></span> <span
									class="input-group-addon f_time"><span
									class="glyphicon glyphicon-calendar"></span></span>
							</div>
						</div>
					</div>
				</div>
				<div class="f_2">
					<div class="form-group col-sm-6">
						<label for="inputEmail3" class="col-sm-3 control-label f_4">门店:</label>
						<div class="col-sm-9 f_6">
							<form:input id="shopName" path="shopName" class="f_5"
								placeholder="门店" />
						</div>
					</div>
					<div class="form-group col-sm-6">
						<label for="conditionType" class="col-sm-3 control-label f_7">合同类型:</label>
						<div class="col-sm-9 f_6">
							<ossp:select dictType="CONTRACT_TYPE" class_="f_5"
								id="contractType" name="contractType"></ossp:select>
						</div>
					</div>
				</div>
			<div class="f_8">
				<div class="f_2">
					<div class="col-sm-8 f_6">
						<form:input id="notifyNo" path="notifyNo" class="f_5"
							placeholder="通知单" />
					</div>
					<button type="submit"  onclick="return checkData()" class="btn btn-warning btn_1">查&nbsp;询</button>
				</div>
			</div>
		</div>
		<tags:message content="${message}" />
		<div class="o-l-search-builder f_9">
			<table
				class="table table-striped table-hover o-l-table table-bordered"
				id="table1">
				<thead class="t_1">
					<tr>
						<th>通知单号</th>
						<th>门店</th>
						<th>合同号</th>
						<th>合同名</th>
						<th>合同类型</th>
						<th>到期日</th>
						<th>金额</th>
						<th>返利金额</th>
						<th>扣款方式</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.list}" var="supplierRebate">
						<tr>
							<td>${supplierRebate.notifyNo}</td>
							<td>${supplierRebate.shopName}</td>
							<td>${supplierRebate.contractNo}</td>
							<td>${supplierRebate.contractName}</td>
							<td><ossp:value dictType="CONTRACT_TYPE"
									key="${supplierRebate.contractType}"></ossp:value></td>
							<td><fmt:formatDate value="${supplierRebate.dueDate}"
									pattern="yyyy-MM-dd" /></td>
							<td>${supplierRebate.amount}</td>
							<td>${supplierRebate.amount}</td>
							<td>${supplierRebate.paymentMethod}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}"
			url="" total="${page.total}" />
		<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	</form:form>
</body>
</html>